{{ $lang := (.Get 0) }}

{{ with ($lang) }}{{ $lang = (printf "language-%s" (.)) }}{{ end }}
{{ $id := (printf "sc-%s-%s" (.Name) (delimit (shuffle (seq 999)) "" | md5)) }}

<div class="shortcode shortcode-{{ ($.Name) }} mb-3">
  <div class="d-flex">
    <div class="flex-grow-1 overflow-hidden">
      <pre class="mb-0"><code id="{{ ($id) }}" class="{{ ($lang) }}">{{ with (.Inner) }}{{ (((trim . "\n\r") | htmlEscape) | safeHTML) }}{{ end }}</code></pre>
    </div>
    <div class="flex-shrink-0">
      <ul class="list-inline mb-0">
        <li class="list-inline-item" data-bs-tooltip data-bs-title='{{ (i18n "sc.code.copy") }}'>
          <a class="text-body-secondary" href="#"
             data-fn="clipboard preventDefault" data-clipboard-target="#{{ ($id) }}"
             role="button">
            <i class="fas fa-copy fa-fw"></i>
          </a>
        </li>
      </ul>
    </div>
  </div>
</div>
